<!DOCTYPE html>
<html lang="en">
	<head>
		<include file="Index/head" />
	</head>

	<body>
		<include file="Index/header" />

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<include file="Index/menu" />
				
				<div class="main-content">
					<include file="Index/nav" />

					<div class="page-content">
						
							<!-- /**
							 * 右侧页面begin
							 */ -->
								<div class="row">
									<div class="col-xs-12">
										<div class="table-header">
											产品列表
										</div>
										<div class="table-responsive">
											<div id="sample-table-2_wrapper" class="dataTables_wrapper" role="grid">
											<div class="row">
											<div class="col-sm-6">
											<div id="sample-table-2_length" class="dataTables_length">
											</div>
											</div>
											<div class="col-sm-6" style="margin-bottom:-20px;">
											<div class="dataTables_filter" id="sample-table-2_filter">
											<p style="margin-top:20px;"><button type="button" class="btn btn-white">添加敏感词</button></p>
											</div>
											</div>                                     
											</div>
	                                        <div>
	                                          <hr/>
	                                            <p><form action="{:U('Admin/Widget/upload_bad_words')}" method="post" enctype="multipart/form-data">
	                                            选择导入文件: <input type="file" name="bad_words" aria-controls="sample-table-2" style="display:inline;">
	                                            <input type="submit" value="导入">
	                                            </form>
	                                            </p>
	                                            <hr/>  
	                                        </div>  
                                                                                            
											<table id="sample-table-2" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
												<thead>
													<tr role="row">
													<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Domain: activate to sort column ascending" >ID</th>
													<th role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Price: activate to sort column ascending">敏感词</th>
													<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Clicks: activate to sort column ascending">所属</th>
													<th  role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" aria-label="Clicks: activate to sort column ascending">创建时间</th>
													<th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" aria-label=""></th></tr>
												</thead>
											<tbody role="alert" aria-live="polite" aria-relevant="all">
											<!-- 循环开始出 -->
											<volist name="list" id="vo">
											<tr class="odd">
												<td class=" ">{$vo.id}</td>
												<td class=" ">{$vo.keywords}</td>
												<td class=" ">
													<if condition="$vo.type eq 1">
													<span style="color:red;">评论</span>
													<else/>
													<span style="color:blue;">昵称</span>
													</if>
												</td>
												<td class=" ">{$vo.ctime|date="Y-m-d H:i:s",###}</td>
												<td class=" ">
													<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
														<a class="red" href="javascript:del_bad_words({$vo.id})">
															<i class="icon-trash bigger-130" title="删除" ></i>
														</a>
													</div>
													<div class="visible-xs visible-sm hidden-md hidden-lg">
														<div class="inline position-relative">
															<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown">
																<i class="icon-caret-down icon-only bigger-120"></i>
															</button>

															<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
																<li>
																	<a href="#" class="tooltip-info" data-rel="tooltip" data-original-title="View">
																		<span class="blue">
																			<i class="icon-zoom-in bigger-120"></i>
																		</span>
																	</a>
																</li>

																<li>
																	<a href="#" class="tooltip-success" data-rel="tooltip" title="" data-original-title="Edit">
																		<span class="green">
																			<i class="icon-edit bigger-120"></i>
																		</span>
																	</a>
																</li>

																<li>
																	<a href="#" class="tooltip-error" data-rel="tooltip" title="" data-original-title="Delete">
																		<span class="red">
																			<i class="icon-trash bigger-120"></i>
																		</span>
																	</a>
																</li>
															</ul>
														</div>
													</div>
												</td>
											</tr>
											</volist>
											<!-- 循环输出结束处 -->
											</tbody>
											</table>
											<div class="row">
												<div class="col-sm-6">
													<div class="dataTables_info" id="sample-table-2_info">Showing 1 to 10 of 23 entries</div>
												</div>
												<div class="col-sm-6">
													<div class="dataTables_paginate paging_bootstrap">
														<ul class="pagination">
															{$show}
														</ul>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>

							<!-- /**
							 * 右侧页面end
							 */ -->
					</div><!-- /.page-content -->
				</div>

			</div><!-- /.main-container-inner  overflow:auto; -->
			<div class="modify_product_div" style="width:30%; border:5px solid #307ECC; background-color:#fff; position:fixed; top:30%; right:40%; display:none;">
				<div class="row">
					<div class="col-xs-12">
						<form class="form-horizontal" role="form" action="{:U('Admin/Widget/add_bad_words')}" method="POST" enctype="multipart/form-data" style="margin-top:5%;">
						<div class="space-4"></div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">敏感词</label>
								<div class="col-sm-9">
									<input type="text" name="keywords" id="form-field-1" required="required" class="col-xs-10 col-sm-5 name">
								</div>
						</div>
						<div class="space-4"></div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right" for="form-field-1">类型</label>
								<div class="col-sm-9">
									<select name="ctype">
										<option value="1">评论</option>
										<option value="2">昵称</option>
									</select>
								</div>
						</div>
						<div class="clearfix form-actions">
							<div class="col-md-offset-3 col-md-9">
								<button class="btn btn-info" type="submit">
									<i class="icon-ok bigger-110"></i>
									修改
								</button>									
							&nbsp; &nbsp; &nbsp;
							<a href="javascript:hide_product_div();">
								<button class="btn" type="button">
									<i class="icon-undo bigger-110"></i>
									撤销
								</button>
							</a>
							</div>
						</div>
							<div class="hr hr-24"></div>
						</div><!-- /row -->
						</form>
				</div>

			</div>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<include file="Index/footer" />
		<script type="text/javascript">
		function del_bad_words(id)
		{
			var r= confirm('确定删除该敏感词?');
			if(r)
			{
				var url = "{:U('Admin/Widget/del_bad_words')}";
				var id = id;
				$.ajax({
					type: 'post',
					url: url,
					data: {id:id},
					dataType: 'json',
					success: function(data){
						if(data==1){
							window.location.href="{:U('Admin/Widget/bad_words_list')}";
						}
					}
				});
			}
			else
			{
				return false;
			}
		}

		function hide_product_div(){

			$(".modify_product_div").hide();
		}

		$(".btn-white").bind('click',function(){
			$(".modify_product_div").show();
		});
		$("#select_classify_id").bind('click',function(){
			var classify_name = $(this).find("option:selected").text();
			$("#classify_name").val(classify_name);
			$("#select_classify_id").hide();
		});
		</script>
	</body>
</html>
